package com.example.express.controller;

import com.example.express.annotation.RateLimit; // 导入自定义注解
import com.example.express.service.ExpressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/express")
public class ExpressController {
    @Autowired
    private ExpressService expressService;

    @RateLimit // 添加限流注解
    @GetMapping
    public ResponseEntity<?> queryExpressInfo(
            @RequestParam String company,
            @RequestParam String number) {
        return ResponseEntity.ok(expressService.queryExpressInfo(company, number));
    }
}